package com.br.unisal.library.business;

import com.br.unisal.library.database.DatabaseOperations;
import com.br.unisal.library.database.LoginDAO;
import com.br.unisal.library.exception.InvalidUserLoginData;
import com.br.unisal.library.operations.settings.LoginOperationSettings;

public class LoginValidator {
	
	private LoginOperationSettings loginSettings;
	private DatabaseOperations databaseOperations;

	public LoginValidator(LoginOperationSettings loginSettings) {
		this.loginSettings = loginSettings;
		databaseOperations = new LoginDAO();	
	}

	public boolean validate() throws InvalidUserLoginData {
		return databaseOperations.validateLogin(loginSettings);
	}

}
